// @ts-ignore
/* eslint-disable */
import request from '@/request'

/** 此处后端没有提供注释 POST /generateExam/add */
export async function addGenerateExam(
  body: API.AddGenerateExamRequest,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseGenExercisesVO>('/generateExam/add', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  })
}

/** 此处后端没有提供注释 POST /generateExam/edit */
export async function updateGenerateExam(
  body: API.GenerateExamEditDTO,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseBoolean>('/generateExam/edit', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  })
}

/** 此处后端没有提供注释 GET /generateExam/get/${param0} */
export async function getGenerateExamVo(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.getGenerateExamVOParams,
  options?: { [key: string]: any }
) {
  const { id: param0, ...queryParams } = params
  return request<API.BaseResponseListGenerateExamVO>(`/generateExam/get/${param0}`, {
    method: 'GET',
    params: { ...queryParams },
    ...(options || {}),
  })
}

/** 此处后端没有提供注释 POST /generateExam/list/page/vo */
export async function listGenerateExamVoByPage(
  body: API.GenerateExamQueryDTO,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponsePageGenerateExamPageVO>('/generateExam/list/page/vo', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  })
}

/** 此处后端没有提供注释 POST /generateExam/upload */
export async function uploadReferenceFile(file:File, options?: { [key: string]: any }) {
// 使用 FormData 构建请求体
  const formData = new FormData();
  formData.append('file', file); // 将文件添加到 FormData

  return request<API.BaseResponseUploadReturnVO>('/generateExam/upload', {
    method: 'POST',
    data: formData,
    ...(options || {}),
  })
}
